package us.mooresr.aircraftscheduling.client;

import us.mooresr.aircraftscheduling.client.events.UserLoggedInEvent;
import us.mooresr.aircraftscheduling.client.events.UserLoggedInEventHandler;

import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.gwtplatform.mvp.client.proxy.Gatekeeper;

@Singleton
public class LoggedInGatekeeper implements Gatekeeper {

	private final LoginStateManager loginStateManager;
	
	// We need to create our own constructor so that we can add a handler to listen for events
	@Inject
	public LoggedInGatekeeper(LoginStateManager loginStateManager) {
		this.loginStateManager = loginStateManager;

	}

	@Override
	public boolean canReveal() {
		return loginStateManager.isLoggedIn();
	}
	


}
